﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="Scripts/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="Scripts/jquery-ui.js"></script>
    <script type="text/javascript" src="Scripts/jquery.zclip.js"></script>
    <style type="text/css">
        .news
        {
            border: 1px solid red;
        }
        
        #main
        {
            width: 100px;
            height: 100px;
            background: red;
            position: relative;
        }
        
        #a
        {
            width: 50px;
            height: 50px;
            background: green;
            position: absolute;
        }
    </style>
</head>
<body class="news">
    <textarea id="text">请输入内容</textarea>
    <a href="#" id="copybtn">复制内容</a>
    <script type="text/javascript">
        $(function () {
            $('#copybtn').zclip({
                //下载的插件中包含如下ZeroClipboard.swf文件
                path: 'js/ZeroClipboard.swf',
                copy: function () {
                    debugger;
                    return $('#text').val();
                },
                afterCopy: function () {
                    debugger;
                    $("#copybtn").after("复制成功");
                }
            });
        }); 
    </script>
</body>
</html>
